import time

from tinyshop.common import start, tinyshop

class judge1:
    def case_01(self,li,e):
        st = start.start()
        re = tinyshop.tinyshopall(st.op)
        ss = re.set(li)
        op = open(r'C:\Users\Administrator\Desktop\caseall\log.txt','a+')
        try:
            key = ss.find_element_by_xpath("//td[2]/div/table/tbody/tr[2]/td[2]/div").text
            if '信息保存成功！' in key:
                print('测试结果通过')
                op.write('%s\n测试结果通过\n\n'%(li))

            else:
                print('测试结果未通过')
                op.write('%s\n测试结果未通过\n\n'%(li))
                pass
        except:
            print('异常')
        time.sleep(1)
        ss.quit()